package com.example.demo.domain;

import lombok.Data;

@Data
public class ResultVO<T> {
    private int status;
    private String msg;
    private T outDO;
    public static <T> ResultVO success(T t){
        ResultVO resultVO=new ResultVO();
        resultVO.setStatus(ResultEnum.SUCCESS.getCode());
        resultVO.setOutDO(t);
        return resultVO;
    }

    public static <T> ResultVO error(String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setStatus(ResultEnum.ERROR.getCode());
        resultVO.setMsg(msg);
        return resultVO;
    }
}
